﻿Option Strict On
Option Explicit On
Option Infer On

Imports System

Public Enum TypeCategory
   [Class] = 0
   [Interface]
   [Enum]
   [Structure]
End Enum

Namespace VB
   Public Module TypeCategoryExtensions
      <System.Runtime.CompilerServices.Extension()> _
      Public Function Output(ByVal category As TypeCategory) As String
         Dim ret As String = String.Empty
         If (category And TemplateSupport.TypeCategory.Class) = TemplateSupport.TypeCategory.Class Then
            ret &= "Class"
         ElseIf (category And TemplateSupport.TypeCategory.Interface) = TemplateSupport.TypeCategory.Interface Then
            ret &= "Interface"
         ElseIf (category And TemplateSupport.TypeCategory.Enum) = TemplateSupport.TypeCategory.Enum Then
            ret &= "Enum"
         ElseIf (category And TemplateSupport.TypeCategory.Structure) = TemplateSupport.TypeCategory.Structure Then
            ret &= "Structure"
         End If
         Return ret
      End Function
   End Module
End Namespace

Namespace CSharp
   Public Module TypeCategoryExtensions
      <System.Runtime.CompilerServices.Extension()> _
      Public Function Output(ByVal category As TypeCategory) As String
         Dim ret As String = String.Empty
         If (category And TemplateSupport.TypeCategory.Class) = TemplateSupport.TypeCategory.Class Then
            ret &= "class"
         ElseIf (category And TemplateSupport.TypeCategory.Interface) = TemplateSupport.TypeCategory.Interface Then
            ret &= "interface"
         ElseIf (category And TemplateSupport.TypeCategory.Enum) = TemplateSupport.TypeCategory.Enum Then
            ret &= "enum"
         ElseIf (category And TemplateSupport.TypeCategory.Structure) = TemplateSupport.TypeCategory.Structure Then
            ret &= "struct"
         End If
         Return ret
      End Function
   End Module
End Namespace